package hu.ikti.obr.test;

import hu.ikti.obr.sync.manager.service.SynchronisationManager;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

public class Activator implements BundleActivator {

	public void start(BundleContext context) throws Exception {
		ServiceReference ref = context
				.getServiceReference(SynchronisationManager.class.getName());

		SynchronisationManager manager = (SynchronisationManager) context
				.getService(ref);

		try {
			manager.synchronise("http://localhost/local-obr/repository.xml");
		} catch (Exception e) {
			System.out.println("Failed to synchronise with repository");
		}
	}

	public void stop(BundleContext context) throws Exception {
	}

}
